#include <bits/stdc++.h>
using namespace std;

class Solution
{
public:
    int main()
    {
        int n;
        cin >> n;
        int iSquare = 1;
        for (int i = 0; i < n; ++i)
        {
            for (int j = 0; j < n; ++j)
            {
                cout << setfill('0') << setw(2) << iSquare;
                ++iSquare;
            }
            cout << endl;
        }

        cout << endl;
        int iTriangle = 1;
        for (int i = 0; i < n; ++i)
        {
            for (int j = 0; j < n - i - 1; ++j)
            {
                cout << "  ";
            }
            for (int j = n - i - 1; j < n; ++j)
            {
                cout << setfill('0') << setw(2) << iTriangle;
                ++iTriangle;
            }
            cout << endl;
        }
        return 0;
    }
};

#ifndef __LOCAL_TEST__
int main()
{
    return Solution().main();
}
#endif